<div class="card-head"><h4>个人中心</h4></div>
<div class="card-block bg-white">
  <div class="block">
    <div class="row">
      <div class="col-md-2">
        <span>昵称</span>
      </div>
      <div class="col-md-4">
        <span [ngStyle]="{'display':editNameFlag?'none':'inline-block'}">{{user.name}}</span>
        <input type="text" [ngStyle]="{'display':editNameFlag?'inline-block':'none'}" [(ngModel)]="user.name" />
        <button class="afterBtn btn btn-outline-info btn-sm" [ngStyle]="{'display':editNameFlag?'none':'inline-block'}" (click)="updateName()">修改昵称</button>
        <button class="afterBtn btn btn-outline-info btn-sm" [ngStyle]="{'display':editNameFlag?'inline-block':'none'}" (click)="updateNameSubmit()">确认</button>
      </div>
    </div>
    <div class="row">
      <div class="col-md-2">
        <span>邮箱地址</span>
      </div>
      <div class="col-md-4">
        <span >{{user.code}}</span>
      </div>
    </div>
    <div class="row">
      <div class="col-md-2">
        <span>密码管理</span>
      </div>
      <div class="col-md-4">
        <button class="btn btn-outline-danger btn-sm">重置密码</button>
      </div>
    </div>
  </div>
  <div style="border-bottom: 1px solid #E5E5E5;margin-top: 1.25rem;margin-bottom:1.25rem"></div>
  <div class="block" *ngIf="user.role=='student'">
    <div class="row">
      <div class="col-md-6">
        <h4 class="first">绑定学号</h4>
        <input type="text" class="input width-full" [(ngModel)]="bindStudentCode" placeholder="学号"/>
        <input type="text" class="input width-full margin-top" [(ngModel)]="bindStudentName" placeholder="姓名"/>
        <input type="text" class="input width-full margin-top" [(ngModel)]="bindCheckCode" placeholder="验证码(通过教师获得)"/>
        <button class="btn btn-success margin-top" (click)="bind()">绑定</button>
      </div>
      <div class="col-md-6">
        <h4 class="first">已绑学号</h4>
        <div style="border-bottom: 1px solid #E5E5E5;margin-top: 1.25rem;margin-bottom:1.25rem"></div>
        <div>{{studentCode}}</div>
      </div>
    </div>
  </div>
</div>



